<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2017/6/6
  Time: 10:18
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <meta charset="utf-8">
    <link rel="stylesheet" href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
    <script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<script type="text/javascript">

    function check(form) {
        if(form.name.value==""){
            alert('输入名字');
            form.name.onfocus;
            return false
        }
        if(form.address.value==""){
            alert('输入名字');
            form.address.onfocus;
            return false
        }if(form.tel.value==""){
            alert('输入名字');
            form.tel.onfocus;
            return false
        }

        return true

    }

</script>

<form class="form-inline" role="form" action="buquanDo" method="post">
    <div class="form-group">
        <label class="sr-only" for="name">名称</label>
        <input type="text" class="form-control" id="name" name="name"
               placeholder="请输入名称"><br/>
    </div>

    <div class="form-group">
        <label class="sr-only" for="name">地址</label>
        <input type="text" class="form-control" id="address" name="address"
               placeholder="请输入地址">
    </div>

    <div class="form-group">
        <label class="sr-only" for="name">tel</label>
        <input type="text" class="form-control" id="tel" name="tel"
               placeholder="请输入tel">
    </div>
    <button type="submit" class="btn btn-default" onclick="return check(this.form)">提交</button>
</form>

</body>
</html>
